<template>
  <div>
    <van-field class="inputText" v-model="content" :label="label" :type="type" :placeholder="placeholder" :rules="rules">
    </van-field>
  </div>
</template>

<script>
export default {
  name: 'LoginText',
  data () {
    return {
      content: ''
    }
  },
  props: ['label', 'type', 'placeholder', 'rules'],
  methods: {},
  watch: {
    // 数据改变时，向父组件传值（方法名：值）
    content () {
      this.$emit('inputChange', this.content)
    }
  }
}
</script>

<style lang="less" scoped>
.inputText {
  margin: 0.268rem 0;
}
</style>
